package com.surveillance.BO;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.surveillance.DAO.AgendaDao;
import com.surveillance.entities.Agenda;

@Service("AgendaBO")
public class AgendaBO implements BOLayer<Agenda>{

	 @Autowired
     private AgendaDao agendaDAO ;
	 
	public void setAgendaDAO(AgendaDao agendaDAO) {
		this.agendaDAO = agendaDAO;
	}

	@Override
	public boolean save(Agenda myEntity) {
		agendaDAO.save(myEntity);
		return true;
	}

	@Override
	public void update(Agenda myEntity) {
		agendaDAO.update(myEntity);
		
	}

	@Override
	public void delete(Agenda myEntity) {
		agendaDAO.delete(myEntity);		
	}

	@Override
	public Agenda findByID(Long myEntityID) {
		return  agendaDAO.findByID(myEntityID);
	}
	@Override
	public List<Agenda> findAll() {
		return agendaDAO.findAll();
	}
	public Agenda getAgendaByNiveauSpec(int niveau, boolean spec, int semestre){
		return ((AgendaDao) agendaDAO).getAgendaByNiveauSpec(niveau, spec, semestre);
	}
	public List<Agenda> getAgendaBySemestre(int semestre){
		return agendaDAO.getAgendaBySemestre(semestre);
	}
}
